package cn.picclife.mwx.common.web.controller;

/**
 * Ajax/Rest 错误返回对象
 * ClassName: ErrorAjaxResponse <br/>
 * date: 2016年9月12日 下午2:07:23 <br/>
 *
 * @author Levi.Wang
 */
public class ErrorRestResponse {
	/** 默认错误返回码10000*/
	private static final String DEFAULT_ERROR_CODE = "10000";

	private String ret;
	private String msg;

	public static ErrorRestResponse failure(String msg) {
		return ErrorRestResponse.failure(DEFAULT_ERROR_CODE, msg);
	}
	
	public static ErrorRestResponse failure(String errorCode, String msg) {
		ErrorRestResponse errorResponse = new ErrorRestResponse();
		errorResponse.setRet(errorCode);
		errorResponse.setMsg(msg);
		
		return errorResponse;
	}

	public String getRet() {
		return ret;
	}

	public void setRet(String ret) {
		this.ret = ret;
	}

	public void setMsg(String msg) {
		this.msg = msg;
	}

	public String getMsg() {
		return msg;
	}
}